<?php $rows = round(count($special_dates) / 2) ?>
<div>
    <?php for ($i = 0; $i < $rows; $i++): ?>
    <div>
        <a href="<?php echo url_for('@reservation_list?date=' . $special_dates[$i * 2]['date']) ?>"
           <?php if (isset($dateAutocomplete)): ?>
           onclick="event.preventDefault(); $('.hasDatepicker').datepicker('setDate', '<?php echo date('d/m/Y', strtotime($special_dates[$i * 2]['date'])) ?>'); checkBlocks();"
           <?php endif ?>>
            <span class="ui-button ui-widget ui-state-active ui-corner-all ui-button-text-only yvo-smallbutton yvo-spdatebutton">
                <span class="ui-button-text yvo-smalltext">    
                    <?php echo $special_dates[$i * 2]['description'] ?><br />
                    <span style="font-size: 0.85em"><?php echo format_date($special_dates[$i * 2]['date'], 'p', 'nl') ?></span>
                </span>
            </span>				
        </a>

        <?php if (isset($special_dates[$i * 2 + 1])): ?>
        <a href="<?php echo url_for('@reservation_list?date=' . $special_dates[$i * 2 + 1]['date']) ?>"
           <?php if (isset($dateAutocomplete)): ?>
           onclick="event.preventDefault(); $('.hasDatepicker').datepicker('setDate', '<?php echo date('d/m/Y', strtotime($special_dates[$i * 2 + 1]['date'])) ?>'); checkBlocks();"
           <?php endif ?>>
            <span class="ui-button ui-widget ui-state-active ui-corner-all ui-button-text-only yvo-smallbutton yvo-spdatebutton">
                <span class="ui-button-text yvo-smalltext">   
                    <?php echo $special_dates[$i * 2 + 1]['description'] ?><br />
                    <span style="font-size: 0.85em"><?php echo format_date($special_dates[$i * 2 + 1]['date'], 'p', 'nl') ?></span>
                </span>
            </span>
        </a>
        <?php endif ?>
    </div>
    <?php endfor ?>
</div>
